<?php
/**
 * @file $HeadURL: attendanceworkday.php $
 * @author $Author: ZhangFan (zhangfan1@haibao.com) $
 * @date $Date: 2016-1-13 $
 * @brief
 */

namespace  haibao\cms\data\attendance;
class AttendanceWorkDay extends \haibao\cms\data\BaseMysql{
    public function __construct(){
        parent::__construct('\haibao\cms\model\data\attendance\AttendanceWorkDay');
    }
    public function updateWorkDay($workDate,$status){
        $sql = "update AttendanceWorkDay set WorkDate=%s,Status =%s where WorkDate =%s";
        $this->query($sql,array($workDate,$status,$workDate));
    }
    public function isExitWorkDate($workDate){
        $sql = "select count(*) as cnt from AttendanceWorkDay where WorkDate=%s";
        $result = $this->query($sql,array($workDate));
        while($result->fetch_assoc()){
           $cnt = $result->getData('cnt');
        }
        if($cnt>0){
            return true;
        }else{
            return false;
        }
    }
}